﻿module;

#include <cstdint>
#include <utility>
#include <vector>
#include <string>
#include <string_view>

#include "zzj.col.hpp"

export module data;

using namespace std::literals;
using namespace col::literals;

export namespace maze
{
	enum class Attr : std::int_fast8_t
	{
		ROAD = 0,	// 路
		WALL,		// 墙
		TRAP,		// 陷阱
		TREASURE	// 宝藏
	};

	struct Obj
	{
		Attr attr{ Attr::WALL };
		std::int16_t val{};
	};

	// 坐标
	using Locate = std::pair<std::int16_t, std::int16_t>;
	// 路径
	using Path = std::vector<Locate>;

	struct Map
	{
		std::vector<std::vector<Obj>> m_map;

		bool inpFrmFile(std::string_view file_name = "map_inp.ini");
		bool out2File(std::string_view file_name = "map_out.ini");

		Path calcPath();
		Path calcPathGraph();
	};


}
